﻿#region References
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Microsoft.Xna.Framework;
using Lidgren.Network;
#endregion

namespace Ness.Engine.Net
{
    static class Serialize
    {
        public static void Matrix(Matrix matrix, NetOutgoingMessage om)
        {
            //Write all MXX values
            om.Write(matrix.M11);
            om.Write(matrix.M12);
            om.Write(matrix.M13);
            om.Write(matrix.M14);

            om.Write(matrix.M21);
            om.Write(matrix.M22);
            om.Write(matrix.M23);
            om.Write(matrix.M24);

            om.Write(matrix.M31);
            om.Write(matrix.M32);
            om.Write(matrix.M33);
            om.Write(matrix.M34);

            om.Write(matrix.M41);
            om.Write(matrix.M42);
            om.Write(matrix.M43);
            om.Write(matrix.M44);
        }

        public static void Entity(Entities.Actor ent, NetOutgoingMessage om)
        {
            //Write entity ID
            om.Write(ent.ToString());

            //Write entity model
            om.Write(ent.model_path);

            //Write entity matrix
            Serialize.Matrix(ent.WorldMatrix, om);
        }
    }
}
